package com.tongcao.cn.constants;

import org.apache.commons.lang3.StringUtils;

/**
 * @Author:tongcao
 * @Date:2018/12/28 17:13
 * Description:
 */
public enum ProcessEnum {

    TONGCAO("TONGCAO", "通草"),
    BOOKER("BOOKER", "布克");

    private String key;
    private String memo;

    ProcessEnum(String key, String memo) {
        this.key = key;
        this.memo = memo;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }


    public static ProcessEnum getPageTypeByKey(String key) {
        for (ProcessEnum pageType : ProcessEnum.values()) {
            if (StringUtils.equalsIgnoreCase(pageType.getKey(), key)) {
                return pageType;
            }
        }
        return null;
    }
}
